const express = require('express')
const app = express()
const router = require('./api_router.js')
const cors = require('cors')
const bodyParser = require('body-parser')

app.use(cors())
app.use(express.static('./public'))
app.use(bodyParser.urlencoded({ extended:false }))
app.use(bodyParser.json())

app.use(router)

app.listen(3001, () => console.log('服务器启动成功!'))